#ifndef _BLADE_H
#define _BLADE_H

#include <boost/circular_buffer.hpp>
#include <utility>
#include <vector>

#include "Entity.h"
#include "GLTexture.h"

class GLSLProgram;

class Blade : public Entity
{
public:
    Blade(boost::shared_ptr<Scene> scene);
    virtual ~Blade(void);

    bool isBladed(const Vector3& position, const Dimension& size) const;

private:
    GLuint m_vertexBuffer;
    GLuint m_colorBuffer;
    static GLSLProgram* m_shaderProgram;
    boost::circular_buffer<std::pair<int,int>> m_bladePoints;

    void onPrepare(float dT);
    void onRender() const;
    void onPostRender();
    bool onInitialize();
    void onShutdown();
    void onDestroy();

    std::vector<GLfloat> vectorize(void) const;

    static int BUFFER_CAPACITY;

};

#endif
